function checkFormAddUserAdmin()
{
	var eUsername	 = $('#txtUsername');
	var ePwd		 = $('#txtPassword');
	
	if (!eUsername.val())
	{
		eUsername.focus();
		return false;
	}
	if (!ePwd.val())
	{
		ePwd.focus();
		return false;
	}
	
	var eGroup = document.getElementById('group_id');
	var eGroupName = document.getElementById('group_name');
	eGroupName.value = eGroup.options[eGroup.selectedIndex].id;
	return true;
}

function initAdminFunc()
{
	var eAdminFunc = document.getElementById('strAdminFunc');
	if (!eAdminFunc.value) return;
	var arrAdminFunc = eAdminFunc.value.split(',');
	var frm = document.getElementById('form');
	var eInput = frm.getElementsByTagName('input');
	var n = eInput.length;
	for(i=0; i<n; i++)
	{
		var e = eInput[i];
		if (e.type=='checkbox' && e.name=='admin_func[]')
		{
			if ( in_array(e.value,arrAdminFunc) )
			{
				e.checked = true;
			}
		}
	}
}